<?php

/**
 * Result form base class.
 *
 * @method Result getObject() Returns the current form's model object
 *
 * @package    question_answer
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseResultForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'question_id' => new sfWidgetFormInputText(),
      'answer_id'   => new sfWidgetFormInputText(),
      'user_id'     => new sfWidgetFormInputText(),
      'point'       => new sfWidgetFormInputText(),
      'check'       => new sfWidgetFormInputCheckbox(),
      'create_at'   => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
      'question_id' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'answer_id'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'user_id'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'point'       => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'check'       => new sfValidatorBoolean(array('required' => false)),
      'create_at'   => new sfValidatorDate(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('result[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Result';
  }


}
